if (LEFT(ADDRESS(), 6) ~= "GOLDED") then /* not started by GoldEd ? */
address 'GOLDED.1'
'LOCK CURRENT RELEASE=4' /* lock GUI, gain access */
if (RC ~= 0) then
exit
OPTIONS FAILAT 6 /* ignore warnings */
SIGNAL ON SYNTAX /* ensure clean exit */
/* ------------------------ INSERT YOUR CODE HERE: ------------------- */
'QUERY USER VAR=USER'
'FIX VAR=USER'
do forever
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nWelcome to the Homepage Wizard !*n*nThis utility will help you to design your*nown homepage.*n*nYou can view the homepage created by this*nprogram with a web browser or upload the*npage to your WWW account so that other*nInternet users can visit your homepage.*n*nPlease enter your name:*n" OLD="' || USER || '" VAR=USER'
if ((RC ~= 0) | (USER ~= "")) then
break
end
if (RC = 0) then do
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nHello ' || USER || ',*n*nPlease enter your title. Leave the field empty*nif you don''t want to have your title displayed*non your home page.*n*nExample: Sales Manager*n" VAR=PROFESSION'
if (RC = 0) then do
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nADDRESS (1/5)*n*nPlease enter your address. Leave the*nfield empty if you don''t want to have your*naddress displayed on your home page.*n*nStreet:*n" VAR=STREET'
if (RC = 0) then do
if (STREET ~= "") then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nADDRESS (2/5)*n*nPlease enter your address. Leave the*nfield empty if you don''t want to have your*naddress displayed on your home page.*n*nCity:*n" VAR=CITY'
if (RC = 0) then do
if (STREET ~= "") then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nADDRESS (3/5)*n*nPlease enter your address. Leave the*nfield empty if you don''t want to have your*naddress displayed on your home page.*n*nState:*n" VAR=STATE'
if (RC = 0) then do
if (STREET ~= "") then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nADDRESS (4/5)*n*nPlease enter your address. Leave the*nfield empty if you don''t want to have your*naddress displayed on your home page.*n*nCountry:*n" VAR=COUNTRY'
if (RC = 0) then do
if (STREET ~= "") then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nADDRESS (5/5)*n*nPlease enter your phone number. Leave the*nfield empty if you don''t want to have your*nphone number displayed on your home page.*n*nPhone number:*n" VAR=PHONE'
if (RC = 0) then do
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nE-MAIL*n*nPlease enter your e-mail address. Leave*nthe field empty if you have no e-mail*naddress or if you don''t want to have*nit displayed on your home page.*n" VAR=EMAIL'
if (RC = 0) then do
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nWelcome message*n*nPlease enter a short welcome message to*nbe included on your page*n" OLD="Thanks for visiting my homepage !" VAR=WELCOME'
if (RC = 0) then do
'REQUEST TITLE="Homepage Wizard" BODY="PICTURE*n*nWould you like to include a picture on*nyour homepage ? Suggested size is 200x200*npixels or smaller.*n*nNote: The picture format should be either*nGIF or JPG." BUTTON="!PICTURE|_No|_Cancel" VAR=SHOWPIC'
if ((RC = 0) & (SHOWPIC ~= 0)) then do
if (SHOWPIC = 1) then do
'REQUEST FILE PATH="golded:tools/www/gif/" TITLE="Select the picture (GIF or JPG)" VAR=GIF'
if ((RC ~= 0) | (GIF = "")) then
SHOWPIC = 0;
end
'REQUEST TITLE="Homepage Wizard" BODY="LINKS*n*nDo you want to have a favourite links*nsection included on your homepage ?" BUTTON="!LINKS|_No|_Cancel" VAR=FAVLINKS'
if ((RC = 0) & (RESULT ~= 0)) then do
if (FAVLINKS = 1) then do
SITES = 0
SUGGEST = 'TRUE'
do forever
if (SUGGEST = 'TRUE') then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nSITE NAME*n*nPlease enter the name of one of your*nfavourite WWW sites:*n" OLD="GoldED Support" VAR=SITENAME'
else
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nSITE NAME*n*nPlease enter the name of one of your*nfavourite WWW sites:*n" VAR=SITENAME'
if ((RC ~= 0) | (RESULT = "")) then
break
'FIX VAR=SITENAME'
if (SUGGEST = 'TRUE') then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nURL*n*nPlease enter the URL pointing to ' || SITENAME || ':*n" OLD="http://www.clearlight.com/~dietmar" VAR=SITEURL'
else
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nURL*n*nPlease enter the URL pointing to ' || SITENAME || ':*n" OLD="http://" VAR=SITEURL'
if (SITEURL = "http://www.clearlight.com/~dietmar") then
'REQUEST STRING TITLE="Homepage Wizard" BODY="*nThe Homepage Wizard wants to create a new*ndrawer for your homepage data.*n*nPlease specify a path (a new drawer *"www*" is*ncreated in the directory you specify):*n" OLD="sys:" VAR=DEST'
if (RC ~= 0) then
break
if (DEST ~= "") then do
if (right(DEST, 1) ~= ':') then
if (right(DEST, 1) ~= '/') then
DEST = DEST || '/'
DEST = DEST || "www"
'FIX VAR=DEST'
if (exists(DEST)) then do
'REQUEST TITLE="Homepage Wizard" BODY="A WWW drawer already exists in this*ndirectory. Overwrite old files ?" BUTTON="!OVER|_No"'
if ((RC ~= 0) | (RESULT = 0)) then
iterate
end
else
'FILE NEWDIR NAME="' || DEST || '"'
'SAVE ALL NAME="' || DEST || '/homepage.html"'
shell
'copy golded:tools/www/data/cnstruct.gif ' || '"' || DEST || '"'
'copy golded:tools/www/data/dot.gif ' || '"' || DEST || '"'
'copy golded:tools/www/data/bckgnd.gif ' || '"' || DEST || '"'
if (SHOWPIC = 1) then
'copy "' || GIF || '" "' || DEST || '"'
shell
'REQUEST TITLE="Homepage Wizard" BODY="Homepage creation completed. All files have*nbeen saved to the following directory:*n*n' || DEST || '*n*nUpload these files to your WWW account so*nthat other users can visit your homepage.*nContact your internet service provider for*ninformation on obtaining WWW accounts and*nuploading files to your account." BUTTON="!OK"'
'REQUEST STATUS="Thank you for using the GoldED Homepage Wizard !"'
leave
end
end
end
end
end
end
end
end
end
end
end
end
/* ---------------------------- END OF YOUR CODE --------------------- */
'UNLOCK' /* VERY important: unlock GUI */
EXIT
SYNTAX:
SAY "Sorry, error line" SIGL ":" ERRORTEXT(RC) ":-("